package Server;

/**
 *
 * Class description goes here.
 *
 * @author Kamil Gajowy
 */
public final class ServerInstance {

    private static volatile ServerInstance instance = null;
    private ServerController serverController;

    public static ServerInstance getInstance() {
        if (instance == null) {
            synchronized (ServerInstance.class) {
                if (instance == null) {
                    instance = new ServerInstance();
                }
            }
        }
        return instance;
    }

    private ServerInstance() {
        serverController = new ServerController();
        System.out.println("Server successfully initialized.");
    }

    public void update() {
        if (instance != null ){
            serverController.update();
        }
    }

    public ServerController getController() {
        return this.serverController;
    }


}//end class
